# Contributor: Miguel Terron <miguel.a.terron@gmail.com>
# Maintainer: Miguel Terron <miguel.a.terron@gmail.com>
pkgname=units
pkgver=2.19
pkgrel=2
pkgdesc="Units conversion and calculation program"
url="https://www.gnu.org/software/units/"
arch="all"
license="GPL-3.0-only"
makedepends="readline-dev python3 py3-requests"
subpackages="$pkgname-doc"
source="http://ftpmirror.gnu.org/units/units-$pkgver.tar.gz"

build() {
	export PYTHON=$(which python3)
	sed -i "1c #!$PYTHON" units_cur
	./configure \
		--build=$CBUILD \
		--host=$CHOST \
		--prefix=/usr \
		--sysconfdir=/etc \
		--mandir=/usr/share/man \
		--localstatedir=/var
	make
}

check() {
	make check
}

package() {
	make DESTDIR="$pkgdir" install
}

sha512sums="f28df8f0b95b53620d4d21ed369551b8510663ff3658293ba62de2722e7dc2d87506db7c65dc192e35f3c3a20842e8ed09ddaa7352532f7e3eaeab4c001061c8  units-2.19.tar.gz"
